/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sda.levelup.threads;

/**
 *
 * @author user
 */
public class FirstThread implements Runnable
{
    private Storage storage;
    boolean a = true;

    public FirstThread(Storage storage)
    {
        this.storage = storage;
    }
    
    
    
    @Override
    public void run()
    {
        while (a){
            String s = "qwerty";
            storage.add(s);
            try{
            Thread.sleep(1000);}
            catch (Exception e){
                e.printStackTrace();
            }
        }
    }
    public void turnOff(){
        a= false;
    }
    
}
